//
var slideIndex=0;
showSlide();

function setSlide(index){
   slideIndex=index;
}

//show slide
function showSlide(){
    var slides=document.getElementsByClassName("slide");
//    var dots=document.getElementsByClassName("dot");
//    if(index>slides.length){
//    slideIndex=0;
//    }
//    if(index<0){
//    slideIndex=slides.length-index;
//    }
//    slideIndex=index;


    //hide all slides
    for(var i=0;i<slides.length;i++){
      slides[i].style.display="none";
//      dots[i].className=dots[i].className.replace(" active","");
//       document.write("-----xixixixi-"+i);
    }

    slides[slideIndex].style.display="block";
//    dots[slideIndex].className+=" active";

    slideIndex++;
    if(slideIndex>=slides.length){slideIndex=0;}

    setTimeout(showSlide,2000);

}
//主页选项
var mainTarget=[
   "http://wap.10010.com/t/common/skip/queryRealTimeFee.htm?navUrlCode=1234",
   "http://wap.10010.com/t/common/skip/queryLeavePackage.htm?navUrlCode=1206",
   "http://wap.10010.com/mobileService/view/client/fill/newMobCharge.jsp?navUrlCode=1176",
   "http://wap.10010.com/t/view/client/stth.jsp?navUrlCode=1223",
   "http://wap.10010.com/t/view/client/wo_share.jsp?navUrlCode=1103",
   "http://wap.10010.com/t/query/einvoice.htm?menuId=000200060012&navUrlCode=1307",
   "http://wap.10010.com/t/upgrade_4g.jsp?navUrlCode=1247",

    "http://wap.10010.com/t/query/queryTranster.htm?listType=hotline&navUrlCode=1211",
];

//广告banner；
var adsTarget=[
   "http://ad.10010.com/uniAdms_2.0/ad/urlProxy?placeCode=ST3_WAP_AD_001&&targetUrl=http://wap.10010.com/t/businessTransact/querySmoothIcePackages.htm&&areaCode=011&&targetId=8a948d8c616a9db901623beef9820267&&placeId=8a948d8b518b5b9a01518bc0f9340007&&sysId=ST_WEB&&template=template_other&&idx=1&&et=et",
   "http://ad.10010.com/uniAdms_2.0/ad/urlProxy?placeCode=ST3_WAP_AD_001&&targetUrl=http://wap.10010.com/mobileService/wap/upload/khd.jsp&&areaCode=011&&targetId=8a948d8c56df73ca01571dc463df0117&&placeId=8a948d8b518b5b9a01518bc0f9330005&&sysId=ST_WEB&&template=template_other&&idx=1&&et=et"
];

//便民服务
var serverTarget=[
   "http://wap.10010.com/t/businessTransact/resetPwd/view.htm?menuId=000100010005&mobile_c_from=bianminfuwu&navUrlCode=1173",
   "http://wap.10010.com/t/view/client/customerService/detailAffiliationPlace.jsp?menuId=000100010002&mobile_c_from=bianminfuwu&navUrlCode=1193",
   "http://wap.10010.com/t/query/queryTranster.htm?listType=clientcomment&navUrlCode=1242"
];

//tab
var tabTarget=[
   "home",
   "server",
   "market",
   "mine",
   "client"
];

function jump(url){
   if(url){
      window.location.href=url;
   }

}

function jump(type,index){
    var url;
    if(type=="main"){
      url=mainTarget[index];
    }else if(type=="ads"){
       url=adsTarget[index];
    }else if(type=="server"){
       url=serverTarget[index];
    }else if(type=="tab"){
       url=null;
       alert(tabTarget[index]);
//       confirm(tabTarget[index]);
//       prompt(tabTarget[index]);
    }

    if(url)
    window.location.href=url;

}
